package juc.reentrantLock;

/**
 * @Description:
 * @Author: yangjie
 * @CreateDate: 2018/6/27 10:47
 */
public class Producer {

    private Depot depot;

    public Producer(Depot depot) {
        this.depot = depot;
    }

    // 消费产品：新建一个线程向仓库中生产产品。
    public void produce(final int val) {
        new Thread() {
            public void run() {
                depot.produce(val);
            }
        }.start();
    }

}
